From: Florian Müllner Date: Fri, 11 Nov 2011 21:41:47 +0000 (+0100) Subject: user-menu: Fix fallout from GDBus port X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7313 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7854024326508f4e86e58fd2306d9ff2fbca9cc4;p=gnome-shell.git user-menu: Fix fallout from GDBus port - replace some left-over references to GnomeSession.Presence.setStatus() - the correct replacement for GnomeSession.Presence.getStatus() is *not* GnomeSession.Presence.connectSignal('StatusChanged') --- diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index 5d84bf972..3ae22720c 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -158,7 +158,7 @@ IMStatusChooserItem.prototype = { this._presence = new GnomeSession.Presence(); this._presence.connectSignal('StatusChanged', Lang.bind(this, function(proxy, senderName, [status]) { - this._sessionStatusChanged(status); + this._sessionStatusChanged(status); })); this._sessionPresenceRestored = false; @@ -293,14 +293,12 @@ IMStatusChooserItem.prototype = { this._setComboboxPresence(presence); if (!this._sessionPresenceRestored) { - this._presence.connectSignal('StatusChanged', Lang.bind(this, function (proxy, senderName, [status]) { - this._sessionStatusChanged(status); - })); + this._sessionStatusChanged(this._presence.status); return; } if (presence == Tp.ConnectionPresenceType.AVAILABLE) - this._presence.setStatus(GnomeSession.PresenceStatus.AVAILABLE); + this._presence.status = GnomeSession.PresenceStatus.AVAILABLE; // We ignore the actual value of _expectedPresence and never safe // the first presence change after an "automatic" change, assuming @@ -455,10 +453,6 @@ UserMenuButton.prototype = { this._idleIcon = new St.Icon({ icon_name: 'user-idle', style_class: 'popup-menu-icon' }); - this._presence.connectSignal('StatusChanged', Lang.bind(this, function (proxy, senderName, [status]) { - this._updateSwitch(status); - })); - this._accountMgr.connect('most-available-presence-changed', Lang.bind(this, this._updatePresenceIcon)); this._accountMgr.prepare_async(null, Lang.bind(this, @@ -474,6 +468,12 @@ UserMenuButton.prototype = { this._updateUserName(); this._createSubMenu(); + + this._updateSwitch(this._presence.status); + this._presence.connectSignal('StatusChanged', Lang.bind(this, function (proxy, senderName, [status]) { + this._updateSwitch(status); + })); + this._userManager.connect('notify::is-loaded', Lang.bind(this, this._updateSwitchUser)); this._userManager.connect('notify::has-multiple-users', @@ -667,7 +667,7 @@ UserMenuButton.prototype = { _("Notifications are now disabled, including chat messages. Your online status has been adjusted to let others know that you might not see their messages.")); } - this._presence.setStatus(status); + this._presence.status = status; }, _onMyAccountActivate: function() {